<template>
  <div class="informx">

   <div class="box">
      <table border="0" width='95%' id="myRelesa1" style="margin-left:20px; font-size:15px; font-weight:normal; text-align: left;vertical-align: super; padding:0 20px;background:#eaeaea;">
        <tr height="60">
          <td width="300">工程名称：{{message.projectName}}</td>
          <td width="300">招标单位：{{message.tenderee}}</td>

        </tr>
        <tr height="40">
          <td >招标代理机构：{{message.tenderCompany}} </td>
          <td >项目类别:{{xiangmu}}</td>
        </tr>
        <tr height="40">
          <td >工期：{{message.schedule}}日历天 </td>
          <td >投标文件递交截止时间：{{format(message.endDate,'yyyy-MM-dd')}}</td>
        </tr>
        <tr height="40">
          <td >投标保证金：{{message.tenderMoney}}元 </td>
          <td >质量要求：合格</td>
        </tr>
        <tr height="40">
          <td >项目地点：{{message.projectLocation}}</td>
          <td >合同估算价：{{message.agreementPrice}}元</td>
        </tr>
        <tr height="40">
          <td >招标地址：{{message.tenderAddress}} </td>
          <td style="color:red;"><span v-if="message.contractStatus==0 ? show1:!show1">固定合同总价</span> <span v-if="message.billStatus==0 ? show1:!show1">增值税专用发票</span>  <span v-if="message.priceStatus==0 ? show1:!show1">超价废标</span> </td>
        </tr>
        <tr height="40">

          <td >联系人：{{message.contactName}}</td>
          <td >联系电话：   {{message.contactMobile}}</td>
        </tr>

      </table>
      <p class="box_title1">需求描述</p>
      <div class="box_net">
        请自行下载招标资料后务必联系87396162进行信息登记以及图纸的领取！！！
        请自行下载招标资料后务必联系87396162进行信息登记以及图纸的领取！！！
      </div>
      <p class="box_title1">投标信息</p>
      <table border="1" width='95%' cellspacing='0' id="myRelesa2" v-if="messages ? true:false" style="margin-left:30px;font-size:18px;text-align: center;">
        <tr height="40">
          <th width="20%">投标公司</th>
          <th width="10%">标编</th>
          <th width="10%">联系人</th>
          <th width="10%">资金状态</th>
          <th width="10%">联系电话</th>
          <th width="10%">推荐人</th>
          <th width="10%">推荐电话</th>
        </tr>
        <tr height="40" style="font-size:13px;" v-for="item in messages">
          <td >{{item.bid_info.bidCompany}}</td>
          <td>{{item.bid_order.id}}</td>
          <td >{{item.bid_info.bidUser}}</td>
          <td >已付款</td>
          <td >{{item.bid_info.bidPhone}}</td>
          <td >{{item.bid_info.referrer}}</td>
          <td >{{item.bid_info.bidMail}}</td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>

  export default {
    data () {
      return {
        message:'',
        messages:'',
        show1:true,
        xiangmu:''
      }
    },
     props: {
        message1: ""
     },
    methods: {
       format(time, format) {
        var t = new Date(time);
        var tf = function(i){return (i < 10 ? '0' : '') + i};
        return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
          switch(a){
            case 'yyyy':
              return tf(t.getFullYear());
              break;
            case 'MM':
              return tf(t.getMonth() + 1);
              break;
            case 'mm':
              return tf(t.getMinutes());
              break;
            case 'dd':
              return tf(t.getDate());
              break;
            case 'HH':
              return tf(t.getHours());
              break;
            case 'ss':
              return tf(t.getSeconds());
              break;
          }
        })
      },
      information(){
         console.log(this.message1,'1')
        let that=this
        $.ajax({
          type: "post",
          url: local+"/awm/userManage/selectByName",
          data: {
            tenderId :this.message1
          },
          dataType: "json",
          success: function(data){
            console.log(data.resultData)
//            that.parentMsg = data.resultData
            if(data.resultData.tender){
              that. message=data.resultData.tender
              if(data.resultData.tender.classification==1){
                that.xiangmu='其他'
              }else if(data.resultData.tender.classification==2){
                that.xiangmu='单一采购'
              }else if(data.resultData.tender.classification==3){
                that.xiangmu='采购及安装'
              }else if(data.resultData.tender.classification==4){
                that.xiangmu='纯劳务'
              }else if(data.resultData.tender.classification==5){
                that.xiangmu='专业分包'
              }

            }
            if(data.resultData.olist){
              that. messages=data.resultData.olist
            }


          },
          error:function(aa){
            console.log(aa)
          }
        });
      }
    },
    mounted: function () {

      $('.informx').width($(document).width()*0.6);
      $('.informx').height($(document).height()*0.5);
      this.information()



    },

    components: {

    }
  }
</script>

<style scoped>
  .informx{
    width:850px;
    height:400px;
    overflow-y: scroll;
  }
  .box{
    width:100%;
    min-height:400px;
  }
  .box_title1{
    margin-top:30px;
    font-size:20px;
    width:100%;
    height:50px;
    line-height:50px;
    text-indent:30px;
  }
  .box_net{
    width:90%;
    height:auto;
    line-height:30px;
    text-align: left;
    text-indent: 30px;
    margin-left:30px;
  }
  #myRelesa1 tr td{
    padding:0 20px;
  }
  #myRelesa1 tr td span{
    float:left;
    margin-right:15px;
  }
</style>
